I have created a bar chart with the following code but the x axis shows the complete timestamp, whereas I just want to show years. For example, I want to show '2008', not '2008-01-01- 00:00:00'. Any pointers on this would be greatly appreciated.
import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates from matplotlib.dates import DateFormatter import datetime as dt